package com.wcll.www;
import java.sql.*;
public class CorporationJobInfoBean {
	private int id;
	private String corrid;
	private String jobsort;
	private String job;
	private String needcount;
	private String sheng;
	private String shi;
	private String xian;
	private String worktime;
	private String describe;
	private static Connection con=null;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getJobSort() {
		return jobsort;
	}
	public void setJobSort(String jobsort) {
		this.jobsort = jobsort;
	}
	public String getJob() {
		return job;
	}
	public void setJob(String job) {
		this.job = job;
	}
	public String getNeedCount() {
		return needcount;
	}
	public void setNeedCount(String needcount) {
		this.needcount = needcount;
	}
	public String getSheng() {
		return sheng;
	}
	public void setSheng(String sheng) {
		this.sheng = sheng;
	}
	public String getShi() {
		return shi;
	}
	public void setShi(String shi) {
		this.shi = shi;
	}
	public String getXian() {
		return xian;
	}
	public void setXian(String xian) {
		this.xian = xian;
	}
	public String getWorkTime() {
		return worktime;
	}
	public void setWorkTime(String worktime) {
		this.worktime = worktime;
	}
	public String getDescribe() {
		return describe;
	}
	public void setDescribe(String describe) {
		this.describe = describe;
	}
	public String getCorrId() {
		return corrid;
	}
	public void setCorrId(String corrid) {
		this.corrid = corrid;
	}
	public static Connection getCon() throws ClassNotFoundException, SQLException {
		if(con==null){
			Class.forName("com.mysql.jdbc.Driver");
			con = DriverManager.getConnection("jdbc:mysql://localhost/jobs?useUnicode=true&characterEncoding=UTF8","root","");
		}
		return con;
	}
	public static void setCon(Connection con) {
		CorporationJobInfoBean.con = con;
	}
public boolean insertCorInfo(CorporationJobInfoBean cji){
		boolean flags = false;
		try{
		con = CorporationJobInfoBean.getCon();
		Statement st = con.createStatement();
		st.executeUpdate("insert into corporation_job_info(id,corr_id,create_time,jaa_id,ja_id,need_count,work_addr_aprivice,work_years,work_describe) values (null,'"+cji.getCorrId()+"',"+"now(),'"+cji.getJob()+"','"+cji.getJobSort()+"','"+cji.getNeedCount()+
							"','"+cji.getSheng()+"','"+cji.getWorkTime()+"','"+cji.getDescribe()+"')");
			if(st.getUpdateCount()==1){
			flags=true;
			st.close();
			con.close();
			}
		}catch(Exception e){}
		return flags;
	}
}

